Skip to content

Add CEL validation tests for NginxProxy #3701

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 23 commits into from
Aug 13, 2025
Merged

Add CEL validation tests for NginxProxy #3701

merged 23 commits into from
Aug 13, 2025

Conversation

shaun-nx
Copy link
Contributor

@shaun-nx shaun-nx commented Aug 7, 2025

Proposed changes

Add tests for CEL validation test for NginxProxy

Closes #3622

Checklist

Before creating a PR, run through this checklist and mark each as complete.

  • I have read the CONTRIBUTING doc
  • I have added tests that prove my fix is effective or that my feature works
  • I have checked that all unit tests pass after adding my changes
  • I have updated necessary documentation
  • I have rebased my branch onto main
  • I will ensure my PR is targeting the main branch and pulling from my branch from my own fork

@shaun-nx shaun-nx requested a review from a team as a code owner August 7, 2025 11:22
@github-actions github-actions bot added the tests Pull requests that update tests label Aug 7, 2025
@shaun-nx
Copy link
Contributor Author

shaun-nx commented Aug 7, 2025

Hi all 👋
Aside from just adding the tests for the cel validation, this PR also refactored the validation functions to make the code more generic. Those changes were done in this commit: Move validation function to common.go

This is why you will see changes to clientsettingspolicy_test.go in this PR

Copy link

codecov bot commented Aug 7, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.91%. Comparing base (2a82c8e) to head (51d49f8).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3701      +/-   ##
==========================================
- Coverage   86.94%   86.91%   -0.03%     
==========================================
  Files         128      128              
  Lines       15962    15962              
  Branches       62       62              
==========================================
- Hits        13878    13874       -4     
- Misses       1917     1921       +4     
  Partials      167      167              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@sjberman
Copy link
Collaborator

sjberman commented Aug 7, 2025

FYI there will be a couple additions when #3702 is merged.

@shaun-nx shaun-nx requested a review from tataruty August 11, 2025 07:12
@shaun-nx
Copy link
Contributor Author

FYI there will be a couple additions when #3702 is merged.

Added the new tests in this commit: 80e121a

@shaun-nx
Copy link
Contributor Author

Made a small few reactors in this commit too: 9bbe4cd

Copy link
Contributor

@ciarams87 ciarams87 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One small comment, otherwise 🚀 !!

@shaun-nx shaun-nx requested a review from ciarams87 August 11, 2025 13:47
@shaun-nx
Copy link
Contributor Author

shaun-nx commented Aug 11, 2025

@ciarams87 when running test-cel-validation locally, I would occasionally run into errors when I had the wrong version of the CRD installed locally.
This change should resolve that: https://github.com/nginx/nginx-gateway-fabric/pull/3701/files#diff-36b847ebf9c22d0651fe4856d7a8acb47ee2c483c79f1ccf0ed8c84889c9a394R194

@shaun-nx shaun-nx requested a review from sjberman August 12, 2025 09:49
@shaun-nx shaun-nx requested review from sjberman and tataruty August 12, 2025 15:45
@shaun-nx shaun-nx merged commit 0cd7d7f into main Aug 13, 2025
44 checks passed
@shaun-nx shaun-nx deleted the tests/cel-nginxproxy branch August 13, 2025 14:39
@github-project-automation github-project-automation bot moved this from 🆕 New to ✅ Done in NGINX Gateway Fabric Aug 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests Pull requests that update tests
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Add CEL tests for NginxProxy CRD
4 participants